//
//  TrackSegment.h
//  LAMapBasicDemo
//
//  Created by 罗亮富 on 2018/1/12.
//  Copyright © 2018年 2Bulu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MapBasics/LAGGeometry.h>

@interface TrackSegment : NSObject<NSCoding,NSCopying>

-(nullable instancetype)initWithPointsData:(nonnull LocationPointType *)dataBuffer pointCount:(size_t)count;

-(nullable instancetype)initWithData:(nonnull NSData *)data;

@property (nonatomic, readonly) LocationPointsSegmentType pointsSegment;
@property (nonatomic, readonly) NSUInteger pointCount;

@property (nullable,nonatomic, readonly) NSData *pointsData;

-(nullable CLLocation *)positionAtIndex:(NSUInteger)index;
-(LocationPointType)pointAtIndex:(NSUInteger)index;

/*
 将轨迹从第index个点开始拆分，第index个点归到了第一段轨迹
 然后返回一个拆分后的TrackSegment实例数组,里面包含两个元素
 如果index范围超出则返回nil
 */
-(nullable NSArray<TrackSegment *> *)dividAtIndex:(NSUInteger)index;




@end
